﻿ <%@ Page Language="C#" MasterPageFile="~/BluePortalMaster.Master" AutoEventWireup="true"
    CodeBehind="UploadVideo.aspx.cs" Inherits="BluePortal.QuikStart.UploadVideo"
    Title="Upload" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<%@ Register Src="UserControls/VideoEdit.ascx" TagName="VideoEdit" TagPrefix="uc1" %>
<%@ Register Src="UserControls/AddTag.ascx" TagName="AddTag" TagPrefix="uc2" %>
<%@ Register Src="UserControls/AddCategory.ascx" TagName="AddCategory" TagPrefix="uc3" %>
<%@ Register assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" namespace="System.Web.UI.WebControls" tagprefix="asp" %>


<asp:Content ID="Content1" ContentPlaceHolderID="DefaultContent" runat="server">

    <script type="text/javascript">
        // JScript source code
        //contains calls to silverlight.js, example below loads Page.xaml
        function createSilverlight()
        {
            Silverlight.createObjectEx({
                source: "PageUpload.xaml",
                parentElement: document.getElementById("fileUploadDiv"),
                id: "SilverlightControl",
                properties: {
                    width: "480",
                    height: "100",
                    version: "1.1"
                },
                events: {},
	            initParams:'uploadUrl=<%= System.Web.Configuration.WebConfigurationManager.AppSettings["UrlUploadService"] + ",videoId=" + vid.ToString() %>,uploadedUrl=<%= System.Web.Configuration.WebConfigurationManager.AppSettings["UrlUploadService"] %>'
            });
        }
    </script>

    <asp:Panel ID="PanelUploadFile" runat="server" CssClass="drawer" style="width:80%">
        <h1>
            Video Upload</h1>
        <div id="fileUploadDiv" class="drawer-content">

            <script type="text/javascript">
                    createSilverlight();
                    function uploadFile_onfocus() {
                        
                    }

            </script>

        </div>
        <div>
            <button type="button" id="uploadFile" onfocus="return uploadFile_onfocus()">
                Click to upload file</button>
            <button type="button" id="pause">
                Pause</button>
            <button type="button" id="resume">
                Resume</button>
            <div id="aa">
            </div>
        </div>
    </asp:Panel>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" >
        <ContentTemplate>
            <uc1:VideoEdit ID="VideoEdit1" runat="server" />
            <div class="drawer">
                <h1>
                    Tag</h1>
                <div class="drawer-content">
                    <uc2:AddTag ID="AddTagVideo1" runat="server" Visible="false" />
                </div>
            </div>
            <div class="drawer">
                <h1>
                    Categories</h1>
                <div class="drawer-content">
                    <uc3:AddCategory ID="AddCategory1" runat="server" Visible="false" />
                </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
